<#assign module="financial"/>

<@override name="header">
</@override>
<@override name="body">

	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-default">
				<div class="panel-heading">
					财务明细
			    </div>
			    <div class="panel-body">
    				<form id="submit_form" action="${ctx}/financialrecord/create" class="form-horizontal" method="post">
		               
		                <div class="form-group">
		                    <label class="col-sm-3 control-label"><em>*</em>金额：</label>
		                    <div class="col-sm-3">
		                    	<input class="form-control" id="money" name="money" type="text" required/>
		                    </div>
		                    <div class="col-sm-5">   
				            	<span id="tip4Desc">本次发生金额,如：100。输入负数表示扣费。0元不生成记录</span>
				            </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-3 control-label"><em>*</em>对象：</label>
		                    <div class="col-sm-3">
		                    	<input class="form-control" id="who" name="who" type="text" required/>
		                    </div>
		                </div>
		                
		                <div class="form-group">
		                    <label class="col-sm-3 control-label"><em>*</em>备注：</label>
		                    <div class="col-sm-5">
		                    	<textarea class="form-control" cols="20" id="memo" name="memo" rows="4" required></textarea>
		                    </div>
		                </div>
		                
		                <div class="form-group" style="margin-left:10px;">
			                <label class="col-sm-3 control-label"></label>
			                <input id="submit_button" type="submit" class="btn btn-primary" value="添加">
			                <input type="button" class="btn btn-default" onclick="window.location.href = '${ctx}/financialrecord/list';" value="返回">
			            </div>
					</form>
        		</div>
			</div>
		</div>
	</div>

</@override>
<@override name="footer">

<script type="text/javascript">
	$(document).ready(function(){

		$("#submit_form").submit(function(){
		
			var money=$("#money").val();
			var reg=/^(-?\d+)(.[0-9]{0,2})?$/;
			if(!reg.test(money)){
		       $.scojs_message('无效的金额，金额必须为数字', $.scojs_message.TYPE_ERROR);
		       return false;
		    }
		    
			$("#submit_button").attr("disabled",true);
			return true;
		});
	
	});
</script>
</@override>
<@extends name="../layout.ftl"/>